package com.mobiusws.reports.dao;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import com.mobiusws.reports.model.CallType;
import com.mobiusws.reports.model.LoginInfo;

@Repository("testDao")
public class TestDao {
	@Resource
	private JdbcTemplate dbxJdbc;
	@Resource
	private JdbcTemplate coreJdbc;
	
	public List<LoginInfo> getLoginInfo() {
		String sql = "select * from login_info";
		List<LoginInfo> list = dbxJdbc.query(sql, new Object[] {},
				new BeanPropertyRowMapper(LoginInfo.class));
		return list;
	}

	public void testQueryFraudSummary() {
		String sql = "select * from login_info";
		List<LoginInfo> list = dbxJdbc.query(sql, new Object[] {},
				new BeanPropertyRowMapper(LoginInfo.class));
		System.out.println("size=" + list.size());
	}

	public void testQueryCallType() {
		String sql = "select * from call_type";
		List<CallType> list = coreJdbc.query(sql, new Object[] {},
				new BeanPropertyRowMapper(CallType.class));
		System.out.println("size=" + list.size());
	}
}
